﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="connDbBean" scope="page" class="com.util.db"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
<script type="text/javascript" src="js/popup.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<TITLE>添加allusers</TITLE>
	    
 	<script type="text/javascript" src="ny/js/jquery.min.js"></script>
<script type="text/javascript" src="ny/js/bootstrap.min.js"></script>
<script src="ny/js/jconfirm/jquery-confirm.min.js"></script>
<link href="ny/css/bootstrap.min.css" rel="stylesheet">
<link href="ny/css/materialdesignicons.min.css" rel="stylesheet">
<link href="ny/css/style.min.css" rel="stylesheet">
<link rel="stylesheet" href="ny/js/jconfirm/jquery-confirm.min.css"> 
	</head>
<%
  String id="";
  id=request.getParameter("id");
   %>

<script language="javascript">

function gows()
{
	document.location.href="allusers_add.jsp?id=<%=id%>";
}
function hsgxia2shxurxu(nstr,nwbk)
{
	if (eval("form1."+nwbk).value.indexOf(nstr)>=0)
	{
		eval("form1."+nwbk).value=eval("form1."+nwbk).value.replace(nstr+"；", "");
	}
	else
	{
		eval("form1."+nwbk).value=eval("form1."+nwbk).value+nstr+"；";
	}
}
</script>
<body>

<div >
              <div class="card-header"><h4>管理员添加</h4></div>
              <div class="card-body">
                <form class="form-horizontal" action="addAllusers.do" method="post" id="form1" name="form1" onSubmit="return checkform();">
                 <div class='form-group' ><label class='col-md-3 control-label'>用户名</label><div class='col-md-7'><input type='text' class='form-control' value='' name='username' id='username' style='width:45%' placeholder='请输入username' /></div></div>
		<div class='form-group' ><label class='col-md-3 control-label'>密码</label><div class='col-md-7'><input type='text' class='form-control' value='' name='pwd' id='pwd' style='width:45%' placeholder='请输入pwd' /></div></div>
		<div class='form-group' style="display:none" ><label class='col-md-3 control-label'>权限</label><div class='col-md-7'><select class='form-control' name='cx' id='cx' style='width:45%'><option value="超级管理员">超级管理员</option><option value="超级管理员">超级管理员</option></select></div></div>
		
				 <div class="form-group">
                    <div class="col-md-9 col-md-offset-3">
                      <button class="btn btn-primary" type="submit" onClick="return checkform();"><i class="mdi mdi-check"></i> 添加</button>
                    </div>
                  </div>
                </form>
              </div>
            </div>
<p>&nbsp;</p>
</body>
</html>



<script language=javascript >  
function hsgcheck() {
		var username = $("#username").val();
		if(username==""||(username.length<3||username.length>12)){
			 $("#clabelusername").html("&lt;font color=red>username不能为空且长度在3～12位之间！&lt;/font>");
			 $("input[id=username]").focus();
			 $("#querenzhuce").attr("disabled","disabled");
			 return false;
		} 
		else
		{
			$("#clabelusername").html("");
			$.ajax({
				url : "quchongAllusers.do",
				type : "post",
				data : "username=" + username,
				dataType : "json",
				success:function(result){
				if(result.info=="ng"){
					$("#clabelusername").html("&lt;font color=red>username已存在，请更换！&lt;/font>");
					$("input[id=username]").focus();
					$("#querenzhuce").attr("disabled","disabled");
					return false;
				}
				else
				{
					$("#querenzhuce").removeAttr("disabled");
				}
				},
				error:function(){
					$("#clabelusername").html("系统异常，请检查错误！");
					$("input[id=username]").focus();
					$("#querenzhuce").attr("disabled","disabled");
					return false;
				}
			});
		}
	}
</script>

<script language=javascript >  
 
 function checkform(){  
 
	var usernameobj = document.getElementById("username"); if(usernameobj.value==""){$.alert('username不能为空');return false;}else{} 
	var pwdobj = document.getElementById("pwd"); if(pwdobj.value==""){$.alert('pwd不能为空');return false;}else{} 
	


return true;   
}   
popheight=450;
</script>  